#pragma once

#include "MathTypes.h"
#include "gtest/gtest.h"

namespace {
// The fixture for testing MathTypes.
class MathTypesTest : public ::testing::Test {
 protected:
  // You can remove any or all of the following functions if its body
  // is empty.

  MathTypesTest() {
    // You can do set-up work for each test here.
  }

  virtual ~MathTypesTest() {
    // You can do clean-up work that doesn't throw exceptions here.
  }

  // If the constructor and destructor are not enough for setting up
  // and cleaning up each test, you can define the following methods:

  virtual void SetUp() {
    // Code here will be called immediately after the constructor (right
    // before each test).
  }

  virtual void TearDown() {
    // Code here will be called immediately after each test (right
    // before the destructor).
  }

  // Objects declared here can be used by all tests in the test case for Foo.
};


TEST_F(MathTypesTest, NormalizedVectorLength) {
	for (int i=0; i<10000000; i++) 
	{
		VECTOR_4 vec = { 
			(float)RAND_MAX - (float)rand()*2.0f, 
			(float)RAND_MAX - (float)rand()*2.0f,
			(float)RAND_MAX - (float)rand()*2.0f, 1.0f};
		VECTOR_4 normalized_vec = vec;		
		ASSERT_FLOAT_EQ(1.0f, normalized_vec.normalize().length()) << "Normalized length must be 1 " << vec;
	}
}


TEST_F(MathTypesTest, DoesXyz) {
  // Exercises the Xyz feature of Foo.
}

}  // namespace